﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Petaframe.Generation
{
    public class GeneratorBase
    {
        public string ConnectionString { get; set; }
        public string Namespace { get; set; }
        public string ClassName { get; set; }
        public string TableName { get; set; }
        public string FilePath { get; set; }
        public string PrimaryKeyColumnName { get; set; }
        public string EnumColumnName { get; set; }
        public string DataTypeNamespace { get; set; }
        public string DataProvider { get; set; }
        public string PrimaryKeyColumnsAsParameter { get; set; }
        public List<string> classList { get; set; }
        public bool IsMSDataProvider;

        public GeneratorBase()
        {
 
        }

        public virtual void Generate()
        {
            throw new NotImplementedException();
        }

        public IDataProvider GetDataProvider()
        {
            IDataProvider dataProvider = null;

            if (this.IsMSDataProvider)
                dataProvider = new SQLDataProvider();
            else
                dataProvider = new OracleDataProvider();

            dataProvider.ConnectionString = this.ConnectionString;
            dataProvider.TableName = this.TableName;

            return dataProvider;
        }
    }
}
